var mongoose = require("../common/db")

var movie = new mongoose.Schema({
	movieName: String,
	movieImg: String,
	movieVideo: String,
	movieDownload: String,
	movieNumSupport: Number,
	movieTime: Number,
	movieNumDownload: Number,
	movieMainPage: Boolean,
})

// 根据id查找电影
movie.statics.findById = function (movie_id, callBack) {
	this.findOne({ _id: movie_id }, callBack)
}

// 查找所有电影
movie.statics.findAll = function (callBack) {
	this.find({}, callBack)
}

var MovieModel = mongoose.model("Movie", movie)

module.exports = MovieModel
